package cn.cloud9;

public class Demo9AboutOrigamiAndEverest {

    /**
     * https://www.bilibili.com/video/BV18J411W7cE?p=46
     * 珠峰与折纸问题
     * 珠峰高度 8844.43米，纸厚度0.1毫米
     * 求纸折叠多少次后的厚度达到珠峰高度？
     * @param args
     */
    public static void main(String[] args) {
        final double TARGET_HEIGHT = 8844.43 * 1000;
        double paperThickness = 0.1;
        int foldCount = 0;
        while (TARGET_HEIGHT >= paperThickness) {
            paperThickness = paperThickness * 2;
            ++ foldCount;
        }
        System.out.printf("纸张厚度%毫米，折叠次数%d\n", paperThickness, foldCount);
    }
}
